<title>登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="#(assets)/css/font/iconfont.css">
<script type="text/javascript" src="#(assets)/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="#(assets)/js/app.js"></script>
<script type="text/javascript" src="#(assets)/js/layer/layer.js"></script>
<style> 
	body{
		font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";
		background-image:url(#(assets)/images/mobile/login-back.png);
		background-size:auto 100%;
	}
	*{margin:0;padding:0;}
	li{list-style-type:none;}
	select,input{-webkit-appearance:none;border:0px;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);   
	}
</style>

<body style="margin:0px;">
<div align=center>
	<div align="center" style="width:100%"> 
		<div>
			<img style="height:120px;margin-top:50px;" src="#(assets)/images/mobile/logo.png">
		</div>
		<div style="width:100%;margin-top:20px;">
			<span id="log_login" style="color:#fa3048;background:#FFF;border-radius:15px;font-size:18px;padding:4px 20px 4px 20px ">登录</span>
			<span id="log_reg" style="color:#FFF;font-size:18px;padding:4px 20px 4px 20px;margin-left:80px;">注册</span>
			<div><img id="logo2" style="height:20px;margin-top:10px;margin-right:160px;" src="#(assets)/images/mobile/logo2.png"></div>
		</div> 
	</div>
	<div id="log_logdiv"  align="center" style="width:80%;clear:both;margin-top:10px;">
		<div style="border-bottom:1px solid #dadada;width:100%;">
			<input placeholder="手机号" id="mobile1" style="padding-left:15px;height:50px;width:100%;border-radius:10px 10px 0 0;font-size:16px;" type="tel"  />
		</div>
		<div style="width:100%;">
			<input placeholder="密码" id="password1" style="padding-left:15px;height:50px;width:100%;border-radius:0px 0px 10px 10px;font-size:16px;" type="password"  />
		</div>
		<div id="log_forget" style="float:right;color:#fff;height:40px;line-height:40px;font-size:16px;">
			<a id="log_forgeturl">忘记密码？</a>
		</div>
	</div>
	<!--注册-->
	<div id="log_regdiv" align="center" hidden style="width:80%;clear:both;margin-top:10px;">
		<div style="border-bottom:1px solid #dadada;width:100%;height:50px;">
			<input placeholder="手机号" id="mobile" style="padding-left:15px;height:50px;width:100%;border-radius:10px 10px 0 0;font-size:16px;" type="tel"  />
		</div>
		<div style="width:100%;border-bottom:1px solid #dadada;height:50px;">
			<input placeholder="验证码" id="code" style="float:left;padding-left:15px;height:50px;width:60%;font-size:16px;border:0px;border-radius:0 0 0 0;" type="tel"  />
			<input id="log_getcode" style="float:right;border:0px;border-radius:0 0 0 0;color:#fa3048;height:50px;width:40%;font-size:16px;background:#FFF" value="获取验证码" type="button"  />
		</div>
		<div style="width:100%;height:50px;">  
			<input placeholder="密码" id="password" style="padding-left:15px;height:50px;width:100%;font-size:16px;border-radius:0 0 10px 10px;border:0px;" type="password"  />
		</div>
		<div style="clear:both;margin-top:10px;">
		<input id="xieyi" type="checkbox" style="vertical-align:middle;-webkit-appearance:checkbox;border:1px solid #000;height:15px;width:15px;" value="" />
		<span style="font-size:13px;">我已经阅读并同意<a style="color:#fff" id="xieyiinfo">《网站服务协议》</a></span>
		</div>
	</div>
	<div align="center"> 
		<div id="log_trueimg" style="clear:both">
			<img style="height:50px;margin-top:20px;" src="#(assets)/images/mobile/log_true.png">
		</div>
	</div>
	<!--注册成功-->
	<div id="log_mengban" hidden style="background-color:rgba(0,0,0,0.4);position:absolute;top:0;width:100%;height:100%;z-index:550"><div>
	<div id="log_tishi" align="center" hidden  style="margin-left:5%;background:#FFF;height:210px;width:90%;position:absolute;top:100px;z-index:600;border-radius:10px;font-size:14px;">
		<div align="center" style="width:100%;margin-top:15px;">
			<img style="height:50px;" src="#(assets)/images/mobile/log_red.png">
		</div>
		 
		<div align="center"  style="width:90%;height:90px;">
			<div style="margin-top:10px;"><a style="font-size:20px;">注册成功</a></div>
			<div style="margin-top:10px;"><a id="regmess" style="font-size:13px;"></a></div>
			<div style="margin-top:10px;"><a style="font-size:13px;color:#ff8338;">您需要身份认证后才能进行投资</a></div>
		</div>
		<div align="center" style="color:#3ec9b4;width:100%;line-height:49px;height:49px;border-top:1px solid #6b6b6b">
			<div align="center" id="log_quxiao" style="width:49.5%;float:left;border-right:1px solid #6b6b6b;"><a>取消</a></div>
			<div id="log_renzheng" align="center" style="width:49.5%;float:right"><a>身份认证</a></div>
		</div>
	</div>
	
</div>
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>  
<script>
	var ip_l=returnCitySN["cip"];
	console.log(ip_l);
	var type = "login";
	//注册
	$("#xieyiinfo").click(function(){
		window.location.href="#(path)/app/page/user-userAgreement";
	});
	$("#log_reg").click( function(){
		$("#log_reg").css({"background":"#FFF","color":"#fa3048","border-radius":"15px"});
		$("#log_login").css({"background":"","color":"#FFF","border-radius":""});
		$("#logo2").css({"margin-right":"-160px"}); 
		$("#log_logdiv").hide();
		$("#log_regdiv").show();
		type = "reg"; 
	});
	//登录
	$("#log_login").click( function(){
		$("#log_login").css({"background":"#FFF","color":"#fa3048","border-radius":"15px"});
		$("#log_reg").css({"background":"","color":"#FFF","border-radius":""});
		$("#logo2").css({"margin-right":"160px"});
		$("#log_logdiv").show();
		$("#log_regdiv").hide();
		type = "login";
	});
	//提交
	$("#log_trueimg").click( function(){
		if(type=="login"){
			ajax("/user/login",{"mobile":$("#mobile1").val(),"password":$("#password1").val(),"type":"wx"},function(data){
				if(data.code=='success'){
					layer.msg(data.msg,{icon:1,time:1000},function(){
						window.location.href="/app/page/index-index";
					}); 
				}else{
					layer.msg(data.msg,{icon:2,time:2000}); 
				}
			});
		}else if(type=="reg"){
			if($('#xieyi').is(':checked')){
				ajax("/user/reg",{"mobile":$("#mobile").val(),"password":$("#password").val(),"sms":$("#code").val(),"ip":ip_l,"type":"wx"},function(data){
					if(data.code=='success'){
						console.log(data);
						$("#log_mengban").show();
						$("#log_tishi").show();
						$("#regmess").html(data.data.tips); 
					}else{
						layer.msg(data.msg,{icon:2,time:1000}); 
					}
				});
			}else{ 
				alert("请确认已经阅读并同意《旺进财网站服务协议》");
			}
		}
	});
	
	//获取验证码
	$("#log_getcode").click( function(){ 
		ajax("/sys/sendCode",{"mobile":$("#mobile").val()},function(data1){
			console.log(data1);
			time(log_getcode);
		});
	});
	
	
	

	
	var wait=60;  
	function time(o) {  
			if (wait == 0) {  
				o.removeAttribute("disabled");            
				o.value="获取验证码";  
				wait = 60;  
			} else {  
				o.setAttribute("disabled", true);  
				o.value="(" + wait + ")";  
				wait--;  
				setTimeout(function() {  
					time(o)  
				},  
				1000)  
			}  
		}  
	 

	
	$("#log_forgeturl").click( function(){
		window.location.href="/app/page/user-forget";
	});
	$("#log_quxiao").click( function(){
		window.location.href="/app/page/user-index";
	});
	$("#log_renzheng").click( function(){
		window.location.href="/app/page/user-auth";
	});
</script>
</body>